import Axios from "../utils/axios";
import api from "../api/index";
import createGrid from "element-plus/es/components/virtual-list/src/builders/build-grid";

//商品分类列表请求      
function productList(cateId:any,name:any ,pageNum:number,pageSize:number) {
  return Axios.get(api.product.productPage,{params:{categoryId:cateId,name:name,pageNum:pageNum,pageSize:pageSize}});
}
//根据id删除
function deleteById(id:any){
  return Axios.delete(api.product.product_+id)
}
//根据id获取
function getById(id:any){
  return Axios.get(api.product.product_+id)
}
//添加新类型
function addNew(form:any){
  return Axios.post(api.product.productAdd,form)
}
//更新
function update(form:any){
  return Axios.put(api.product.product_+form.id,form)
}



export default {
  productList,
  deleteById,
  getById,
  addNew,
  update,
};
